package com.cdh.edu.config;

import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @author cdh
 */
@EnableTransactionManagement
@Configuration
public class MyConfig {
    /**
     *分页插件
     */
    @Bean
    PaginationInterceptor paginationInterceptor(){
        return new PaginationInterceptor();
    }

    /**
     *乐观锁插件
     */
    @Bean
    OptimisticLockerInterceptor optimisticLockerInterceptor(){
        return new OptimisticLockerInterceptor();
    }
}
